<template lang="html">
    <div>
      <div class="btn">
          <el-button type="primary" @click="back">返回上一级</el-button>
      </div>
      <div class="box">
        <OrderDetailVue :orderId="id"/>
      </div>
    </div>
</template>

<script>
  import OrderDetailVue from '@/components/orderDetail.vue'
export default {
  components : {
    OrderDetailVue,
  },
  data () {
      return {
        id : ''
      }
  },
  mounted () {
    this.id = this.$route.query.id
  },
  methods :  {
    back () {
      if (this.$route.query.num == 1) {
        this.$router.push({
          name :  'orderDetails',
          query : {
            id : this.$route.query.workid,
            key :this.$route.query.key
          }
        })
      } else if (this.$route.query.num == 3) {
           this.$router.push({ name: 'userDetails',query : {id : this.$route.query.userId}})
      } else {
        this.$router.push({
          name : 'consignIndent'
        })
      }
    }
  }
}
</script>

<style scoped>
.box {
  background: #fff;
  padding-top: 20px;
}
  .btn {
    margin-top: 20px;
    margin-bottom: 20px;
  }
</style>
